﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TelerikSample.aspx.cs" Inherits="QLHD.TelerikSample" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnResponseEnd="SelectEvent();callbackFunction();"
        ClientEvents-OnRequestStart="requestStart" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
        DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
        <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    
                </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  />
    <telerik:RadGrid ID="RadGrid1" Width="100%" runat="server" AllowAutomaticDeletes="True"
         AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AllowMultiRowSelection="True" AllowPaging="True" SortingSettings-SortToolTip="Sắp xếp"
        AutoGenerateColumns="False" ShowStatusBar="True" AllowSorting="True" OnNeedDataSource="RadGrid1_NeedDataSource"
         CellSpacing="0" GridLines="None" EnableLinqExpressions="false" >
        <sortingsettings sorttooltip="Sắp xếp"></sortingsettings>
        <exportsettings ignorepaging="true" openinnewwindow="true" exportonlydata="true">
                    <Excel Format="ExcelML" />
                </exportsettings>
        <groupingsettings casesensitive="false" />
        <mastertableview editmode="InPlace" pagerstyle-position="TopAndBottom" pagerstyle-mode="NumericPages"
            tablelayout="Auto" commanditemdisplay="Top" datakeynames="Id" clientdatakeynames="Id">
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridClientSelectColumn UniqueName="Id" Resizable="false" ItemStyle-Width="3%" >
                            <ItemStyle Width="3%"></ItemStyle>
                        </telerik:GridClientSelectColumn>
                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="STT" HeaderText="STT" 
                            ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px"
                            >
                            <ItemTemplate>
                                <%#   Convert.ToInt16(DataBinder.Eval(Container, "RowIndex")) != -1 ? Convert.ToInt16(DataBinder.Eval(Container, "RowIndex")) - 1 + ((RadGrid1.MasterTableView.CurrentPageIndex) * RadGrid1.MasterTableView.PageSize) : 0 %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Font-Bold="true"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center" Width="4%"></ItemStyle>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="Code" HeaderText="Mã SV" UniqueName="Code" ItemStyle-Width="6%"
                            >
                            <ItemStyle Width="6%"></ItemStyle>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerTemplate>
                        <asp:Panel ID="PagerPanel" Style="padding: 6px; line-height: 24px" runat="server"
                            CssClass="panel_pager" meta:resourcekey="PagerPanelResource1">
                            <div style="float: left" class="c_PageSize">
                                <span style="margin-right: 3px;">Hiển thị:</span>
                                <telerik:RadComboBox CssClass="number-pager" ID="RadComboBox1" DataSource="<%# new object[]{10, 20, 30, 40, 50, 100, 200} %>"
                                    Style="margin-right: 20px;" Width="40px" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'
                                    runat="server" OnClientSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
                                    meta:resourcekey="RadComboBox1Resource1">
                                </telerik:RadComboBox>
                            </div>
                            <div class="panel_page_button" style="width: 260px; margin: 0px; padding: 0px; float: left;
                                margin-right: 10px; white-space: nowrap;">
                                <asp:Button ID="Button1" runat="server" OnClientClick="changePage('first'); return false;"
                                    CommandName="Page" CommandArgument="First" Text=" " CssClass="PagerButton FirstPage"
                                    meta:resourcekey="Button1Resource1" />
                                <asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;"
                                    CommandName="Page" CommandArgument="Prev" Text=" " CssClass="PagerButton PrevPage"
                                    meta:resourcekey="Button2Resource2" />
                                <span style="vertical-align: middle;">
                                    <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                                    /
                                    <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                                </span>
                                <asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;"
                                    CommandName="Page" CommandArgument="Next" Text="Next " CssClass="PagerButton NextPage"
                                     />
                                <asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;"
                                    CommandName="Page" CommandArgument="Last" Text="Last " CssClass="PagerButton LastPage"
                                     />
                            </div>
                            <asp:Panel runat="server" ID="NumericPagerPlaceHolder" meta:resourcekey="NumericPagerPlaceHolderResource1" />
                        </asp:Panel>
                    </PagerTemplate>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="true" Mode="NumericPages" />
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                    <RowIndicatorColumn UniqueName="Id" Visible="False">
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                </mastertableview>
        <edititemstyle backcolor="Transparent" />
        <selecteditemstyle backcolor="Transparent" />
        <clientsettings>
                    <Selecting AllowRowSelect="true" />
                    <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnRowDeselected="RowDeselected" OnRowSelected="RowSelected" 
                        OnCommand="GridCommand" />
                </clientsettings>
        <filtermenu enableimagesprites="False">
                </filtermenu>
        <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default">
                </headercontextmenu>
    </telerik:RadGrid>
</asp:Content>
